import logging

class TestLogging(object):
    def __init__(self):
        logFormat = '%(asctime)-12s %(levelname)-8 %(name)-10s $(message)-12s'
        logFileName = './testLog.txt'
        logging.basicConfig(level = logging.INFO,
                            format = logFormat,
                            filename = logFileName,
                            filemode = 'a')

        logging.debug('debug message')
        logging.info('info message')
        logging.warning('warning message')
        logging.error('error message')
        logging.critical('critical message')


if __name__ == '__main__':
    t1 = TestLogging();


